package org.example.struct.array;

/**
 * @author liyishan
 * @date 2024/7/16 13:16
 * @apiNote
 */

public class Test00944MinDeletionSize {
    public static void main(String[] args) {
        String[] strs = {"a","b"};
        System.out.println(minDeletionSize(strs));
    }

    public static int minDeletionSize(String[] strs) {
        int n = strs.length;
        int m = strs[0].length();
        int count = 0;
        for (int i = 0; i < m; i++) {
            for (int j = 1; j < n; j++) {
                if(strs[j].charAt(i) <strs[j-1].charAt(i)){
                    count++;
                    break;
                }
            }
        }
        return count;
    }
}
